package com.xjl.common.mybatisplus.config;

import com.xjl.common.mybatisplus.interceptor.SqlBeautyInterceptor;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class MyBatisConfig {

    //配置自定义拦截器,填充日志(?,?)
    @Bean
    @ConditionalOnProperty(name = {"sql.beauty.show"},havingValue="true",matchIfMissing = true)
    public SqlBeautyInterceptor sqlBeautyInterceptor(){
        return new SqlBeautyInterceptor();
    }
}
